Skip to content

Added all the modified files#310

Open
vijayrap wants to merge 3 commits into
masterfrom
contrail-monitor-work-2008R
Open

Added all the modified files#310
vijayrap wants to merge 3 commits into
masterfrom
contrail-monitor-work-2008R

Conversation

@vijayrap

Copy link
Copy Markdown
Collaborator

No description provided.

@vijayrap

Copy link
Copy Markdown
Collaborator Author

vraparla-mbp:crds vraparla$ kubectl get contrailstatusmonitor -n contrail
NAME STATUS
cassandra1 Active
contrail-analytics-api Functional
contrail-api Functional
contrail-collector Functional
contrail-device-manager initializing
contrail-schema Functional
contrail-svc-monitor Functional
keystone Active
memcached Active
postgres Active
provmanager1 Active
rabbitmq1 Active
redis Functional
webuijob Functional
webuiweb Functional
zookeeper1 Active
vraparla-mbp:crds vraparla$


Ran couple of times.

listKind: PostgresList
plural: postgres
singular: postgres
scope: Namespaced

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update operator-sdk to version v0.17.1 as described in documentation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per document, for 2008R we are using the older version, I have noticed u have changes done in master not in 2008R.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but this is PR to master

Comment thread test/env/deploy/cluster.yaml Outdated
commonConfiguration:
activate: true
create: true
activate: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this changed from true to false?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

// Note:
// The Controller will requeue the Request to be processed again if the returned error is non-nil or
// Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
func (r *ReconcileContrailmonitor) Reconcile(request reconcile.Request) (reconcile.Result, error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any unit tests for that controller. As far as I know there is a requirement that a new code should be covered by unit tests

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover I strongly suggest to extend one of the e2e tests that will verify happy path. Just a single simple check

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not included unit test or e2e test cases here, I have noticed it, the reason is, I get very inconstant results, One day, I get one results, other day, i get completly diffrent results., I like you to suggest me what is wrong in the code that gives varied results. for example, even if the postgres service is active as it updates my additional print coloums crd instance it updates the field as Not active. it is very random

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If your code works inconsistently you should write unit tests and e2e tests and fix it. That is test driven development.

if err != nil {
return reconcile.Result{}, err
}
fmt.Println(clist.Items[0].Status.ServiceStatus)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a debug log. Please use logger or remove it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove it.

}
serIns3 := &contrailv1alpha1.Contrailstatusmonitor{ObjectMeta: metav1.ObjectMeta{Name: provisionmanager.Name, Namespace: "contrail"}}

if provisionmanager.Status.Active == nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if status.Active is false?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we report "Active"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, WE need to report Active/NotActive for postgres, provisionmanager, zookeeper, cassandra etc.

Yes, I have noticed the point that you have raised, These fields in the crds are boolean pointers, I can check boolean pointer as the GCP build raised Panic error, which is not raised by the blazel build, so, after couple of iterations , I have decided with 2 values nil and true, I tried to even check the IsAlive function that cassandra, zookeper, rabbitmq used to to test the pod activity, I noticed they are very inconsiatnat in returning the value.

@vijayrap vijayrap requested a review from kaweue August 12, 2020 00:44
@vijayrap

Copy link
Copy Markdown
Collaborator Author

Added my points, I need ur review on few points, My results are very inconsistent on day to day basis. I don't know the reason, Specially, when the CRD updates the status field , even though the work flow captures "active" it reports and updates as "notActive", on another service, it captures correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants